package view.pane;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import controller.human.User;

import view.Gui;

@SuppressWarnings("serial")
public class NightPaneResult extends JPanel {

	public NightPaneResult(final Gui gui) {
		add(new JLabel("You already played this night"));
		add(new JButton(new AbstractAction("Done") {
			public void actionPerformed(ActionEvent arg0) {
				gui.updatePane(new NightPane(gui));
			}
		}));
	}

	public NightPaneResult(final Gui gui, User target, boolean isKiller) {
		if (isKiller) {
			add(new JLabel("" + target.getName() + " is a killer"));
		} else {
			add(new JLabel("" + target.getName() + " is NOT a killer"));		
		}
		add(new JButton(new AbstractAction("Done") {
			public void actionPerformed(ActionEvent arg0) {
				gui.updatePane(new NightPane(gui));
			}
		}));
	}

}
